package com.hgy.chapter3.rest;

import javax.ws.rs.Consumes;
import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

import com.hgy.chapter3.model.Customer;
import com.hgy.chapter3.service.CustomerService;
import com.hgy.framework.annotation.Inject;
import com.hgy.framework.annotation.Service;
import com.hgy.plugin.rest.annotation.Rest;

@Rest
@Service
@Consumes(MediaType.APPLICATION_JSON)
@Produces(MediaType.APPLICATION_JSON)
public class CustomerRestService {
	
	@Inject
	private CustomerService customerService;
	
	@GET
	@Path("/customer/{id}")
	public Customer getCustomer(@PathParam("id") long id){
		return customerService.getCustomer(id);
	}
}
